<template>
  <div>孙组件--{{ msg }}</div>
</template>

<script>
import EventBus from "@/EventBus";
export default {
  created() {
    //订阅
    EventBus.$on("my-event", (num) => {
      console.log(num);
    });
  },
  inject: {
    msg: {
      type: String,
    },
  },
  data() {
    return {};
  },
  methods: {},
};
</script>

<style scoped></style>
